import type { FormSchema } from '@/components/core/schema-form/';

export const useFormSortSchema = (): FormSchema<API.AddDictParams>[] => [
  {
    field: 'no',
    component: 'Input',
    label: '字典编号',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'name',
    component: 'Input',
    label: '字典名称',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'dataType',
    component: 'RadioGroup',
    label: '字典类型',
    defaultValue: '1',
    rules: [{ required: false, type: 'string' }],
    componentProps: {
      options: [
        {
          label: '静态数据',
          value: '0',
        },
        {
          label: 'SQL数据',
          value: '1',
        },
        {
          label: '接口数据',
          value: '2',
        },
      ],
    },
  },
  {
    field: 'status',
    component: 'RadioGroup',
    label: '字典状态',
    defaultValue: '1',
    rules: [{ required: false, type: 'string' }],
    componentProps: {
      options: [
        {
          label: '停用',
          value: '0',
        },
        {
          label: '正常',
          value: '1',
        },
      ],
    },
  },
  {
    field: 'doc',
    component: 'InputTextArea',
    label: '值',
    rules: [{ required: false, type: 'string' }],
  },
  {
    field: 'remark',
    component: 'InputTextArea',
    label: '备注',
    rules: [{ required: false, type: 'string' }],
  },
];
